// 视图组件
const view = {
  tabs: () => import('@/layouts/tabs'),
  blank: () => import('@/layouts/BlankView'),
  page: () => import('@/layouts/PageView')
}

// 路由组件注册
const routerMap = {
  login: {
    authority: '*',
    path: '/login',
    name: '登录',
    component: () => import('@/pages/login')
  },
  root: {
    path: '/',
    name: '首页',
    redirect: '/dashboard',
    component: view.tabs
  },
  dashboard: {
    name: '仪表盘',
    icon: 'dashboard',
    component: () => import('@/pages/dashboard/workplace'),
  },
  demand: {
    name: '需求管理',
    icon: 'form',
    component: { render: h => h("router-view") }
  },
  demandProcessing: {
    path: 'processing',
    name: '处理中',
    component: () => import('@/pages/demand/processing'),
  },
  demandFinished: {
    path: 'processed',
    name: '已完成',
    component: () => import('@/pages/demand/processed'),
  },
  demandStop: {
    path: 'processedStop',
    name: '已中止',
    component: () => import('@/pages/demand/processedStop'),
  },
  surveyAdd: {
    path: 'surveyAdd',
    name: '添加或编辑需求调研',
    component: () => import('@/pages/demand/surveyAdd'),
    invisible: true
  },
  surveyDetail: {
    path: 'surveyDetail',
    name: '需求调研详情',
    component: () => import('@/pages/demand/surveyDetail'),
    invisible: true
  },
  demandDetail: {
    path: 'detail',
    name: '需求详情',
    component: () => import('@/pages/demand/detail'),
    invisible: true
  },
  demandAdd: {
    path: 'add',
    name: '新增或变更需求',
    component: () => import('@/pages/demand/add'),
    invisible: true
  },
  task: {
    name: '任务管理',
    icon: 'profile',
    component: () => import('@/pages/task/index'),
  },
  taskProcessing: {
    path: 'processing',
    name: '处理中',
    component: () => import('@/pages/task/processing'),
  },
  taskFinished: {
    path: 'processed',
    name: '已完成',
    component: () => import('@/pages/task/processed'),
  },  
  taskStop: {
    path: 'processedStop',
    name: '已中止',
    component: () => import('@/pages/task/processedStop'),
  },
  taskDetail: {
    path: 'detail',
    name: '任务详情',
    component: () => import('@/pages/task/detail'),
    invisible: true
  },
  taskAdd: {
    path: 'add',
    name: '任务新增或变更',
    component: () => import('@/pages/task/add'),
    invisible: true
  
  },
  project: {
    name: '项目管理',
    icon: 'project',
    component: { render: h => h("router-view") }
  },
  projectIndex: {
    path: 'index',
    name: '项目列表',
    component: () => import('@/pages/project/index'),
  },
  projectDetail: {
    path: 'detail',
    name: "项目详情",
    component: () => import('@/pages/project/detail'),
    invisible: true
  },
  projectAdd: {
    path: 'add',
    name: "新增或变更项目",
    component: () => import('@/pages/project/add'),
    invisible: true
  
  },
  produce: {
    name: '产品管理',
    icon: 'bulb',
    component: { render: h => h("router-view") }
  },
  produceIndex: {
    path: 'index',
    name: "产品列表",
    component: () => import('@/pages/produce/index'),
  },
  produceDetail: {
    path: 'detail',
    name: "产品详情",
    component: () => import('@/pages/produce/detail'),
    invisible: true
  },
  produceAdd: {
    path: 'add',
     name: "新增/编辑产品",
     component: () => import('@/pages/produce/add'),
     invisible: true
  },
  setting: {
    name: '账号管理',
    icon: 'user',
    component: { render: h => h("router-view") }
  },
  departmentIndex: {
    path: 'department',
    name: "部门列表",
   component: () => import('@/pages/department/index'),
  },
  roleIndex: {
    path: 'role',
    name: '角色列表',
    component: () => import('@/pages/user/role'),
  },
  roleAdd: {
    path: 'roleAdd',
    name: '角色添加或者修改',
    invisible: true ,
    component: () => import('@/pages/user/roleAdd')
  },
  menuIndex: {
    path: 'menu',
    name: "菜单列表",
    component: () => import('@/pages/menu/index'),
  },
  userIndex: {
    path: 'user',
    name: '账号列表',
    component: () => import('@/pages/user/user'),
  },
  userAdd: {
    path: 'userAdd',
    name: '账号添加或者修改',
    invisible: true ,
    component: () => import('@/pages/user/UserAdd.vue')
  
  },
 permissionIndex: {
  path: 'permissions',
  name: '权限列表',
  component: () => import('@/pages/user/permissions')
  },
  permissionAdd: {
    path: 'permissionsAdd',
    name: '权限添加或者修改',
    invisible: true,
    component: () => import('@/pages/user/permissionsAdd')
  },
  UserSetting: {
    path: 'user',
    invisible: true,
    name: '账户设置',
    component: () => import('@/pages/user/UserSetting')
  },

  
  exp404: {
    name: 'exp404',
    path: '404',
    component: () => import('@/pages/exception/404')
  },

}
export default routerMap

